<!DOCTYPE HTML>
<html>
<head>
    <title>Error</title>
    <link rel="stylesheet" href="/stylesheets/style.css">
    <script src="/scripts/jquery.min.js"></script>
    <link rel="stylesheet" href="/scripts/miniui/themes/default/miniui.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/icons.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/bootstrap/skin.css">
    <script src="/scripts/miniui/miniui.js"></script>
</head>
<body>
    <span style="width:80px;display:inline-block;">用户姓名：</span>
    <input id="name" class="mini-textbox" style="width:155px;" value='<%= result.data[0].name %>'/>

    <span style="width:80px;display:inline-block;margin-left: 30px">电话号码：</span>
    <input id="tel" class="mini-textbox" style="width:170px;" value='<%= result.data[0].tel %>'/>
    <br/><br/>

    <span style="width:80px;display:inline-block;">审核状态：</span>
    <input id="status" class="mini-combobox" style="width:155px;" data="userStatus" value='<%= result.data[0].status %>'/>

    <span style="width:80px;display:inline-block;margin-left: 30px">身份证号：</span>
    <input id="identityCardNo" class="mini-textbox" style="width:170px;" value="<%= result.data[0].identityCardNo %>"/>

    <br/><br/>

    <span style="width:80px;display:inline-block;">审核理由：</span>
    <textarea id="reason" class="mini-textarea"  value="<%= result.data[0].reason%>" style="width: 190px"></textarea>

    <br/><br/>
    <div style="margin: 0 auto;text-align: center">
        <a class="mini-button " iconCls="icon-ok" onclick="updataUserStatus()">确定</a>
        <a class="mini-button" iconCls="icon-cancel" onclick="onCancel">取消</a>
    </div>
</body>
<script>
    var userStatus = [{ id: 1, text: '审核成功' }, { id: 0, text: '未审核'},{ id: 4, text: '审核失败'},{ id: 3, text: '审核中'}];
    var objectId = '<%= result.data[0].objectId%>';
    function updataUserStatus() {
        var name = mini.get("name").getValue();
        var tel = mini.get("tel").getValue();
        var identityCardNo = mini.get("identityCardNo").getValue();
        var reason = mini.get("reason").getValue();
        var status = mini.get("status").getValue();

        $.ajax({
            type: "POST",
            url: "/getdata/updataUserStatus",
            data: {
                objectId: objectId,
                name: name,
                tel: tel,
                identityCardNo: identityCardNo,
                reason: reason,
                status: status,
            },
            success: function (result) {
                CloseWindow("save");
            }
        })
    }
    //    关闭窗口
    function CloseWindow(action) {
        if (action == "close" && form.isChanged()) {
            if (confirm("数据被修改了，是否先保存？")) {
                return false;
            }
        }
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();
    }
    function onOk(e) {
        SaveData();
    }
    function onCancel(e) {
        CloseWindow("cancel");
    }
</script>
</html>